<div id="left">
	Categories
	<div class="new-item"><a href="<?php echo site_url('admin/newCategory'); ?>">Add Category</a></div>
	<ul>		
		<?php 
			foreach($categories as $category)
			{
				echo '<li>'.$category['category'].'</li>';
			}
		?>
	</ul>
</div>
<div id="new_content">
	<h2><?php echo $edit_category['category']; ?></h2>
	<form action="<?php echo site_url('admin/editCategory/'.$edit_category['id']); ?>" method="post" >
	<table>
		<tr>
			<td>Category: </td>
			<td><input type="text" name="category" value="<?php echo $edit_category['category']; ?>"/></td>
		</tr>
		<tr>
			<td>Sub Category: </td>
			<td>
				<select name="sub_category">
				<?php
					foreach($categories as $category)
					{
						if($category['id'] != $edit_category['id'])			
						{			
				?>
					<option value="<?php echo $category['id']; ?>" <?php if($category['id'] == $edit_category['sub_category']) echo 'selected="selected"' ?>><?php echo $category['category']; ?></option>
				<?php
						}
					}
				?>
				</select>
			</td>
		</tr>
		<tr>
			<td>Order (STT)</td>
			<td>
				<input type="text" name="order" value="">
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<input type="submit" name="submitBtn" value="Submit">
				<input type="reset" name="resetBtn" value="Reset">
			</td>
		</tr>
	</table>
	</form>
</div>